function I = searchFilledFields(Obj)
%searchFilledFields - search of filled fields of a struct or an object
%
%   searchFilledFields(Obj)
%
% If Obj is an object of a struct variable, I is true for all fields 
% whose values are non-empty, false elsewere.
% If Obj is neither an object non a struct variable, I = [] and a warning
% message is shown.

% G. Teza, 2021

try
    fs = fields(Obj);
    ns = numel(fs);
    I = false(ns,1);
    for k = 1:ns
        if ~isempty(Obj.(fs{k}))
            I(k) = true; 
        end
    end
catch
    fprintf('Warning: the input valiable is not struct or object\n');
    I = [];
end

